(function () {
    axios.get('/api/qqq', {
        params: {
            cid: 2
        }
    }).then(function (res) {
        console.log(res);
        document.getElementsByClassName('addtime')[0].innerHTML = res.data[0].addtimes.split('T')[0];

    }).catch(function (error) {
        console.log(error);
    });

    const reply = document.getElementsByClassName('reply')[0];
    const repcont = document.getElementsByClassName('repcont')[0];
    // const e = document.getElementById('#editor-container');
    reply.addEventListener('click', repFn);
    function repFn() {
        console.log(html);
        axios.get('/api/reply', {
            params: {
                content: html,
                uid: 1,
                aid: 9,

            }

        }).then(function (res) {
            // console.log(res.data.data.split('<p>')[1].split('</p>')[0]);
            // repcont.innerText = res.data.data.split('<p>')[1].split('</p>')[0];

            repcont.innerHTML = decodeURI(res.data.content);
            console.log(res);
            document.getElementById('editor-container').innerHTML = '';
        }).catch(function (error) {
            console.log(error);


        });
    }

    //评论

})();